package com.woniu.feignClient;

import com.alibaba.fastjson.JSONException;
import com.woniu.cancelOrderInfo;
import com.woniu.ly.model.common.Result;
import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.Timestamp;
import java.util.List;

@FeignClient("user")
public interface UserFeignClient {
    @PostMapping("user/login")
    public Result login(@RequestParam String userName, @RequestParam String userPassword);
    @PostMapping("user/register")
    public Result register(@RequestParam String userName, @RequestParam String userPassword, @RequestParam String userTel);
    @GetMapping("user/selectProduct")
    public Result selectProduct(@RequestParam String keyWord);
    @GetMapping("user/selectOrder")
    public Result selectOrder(@RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "3") int pageNum,HttpServletRequest httpServletRequest);
    @PostMapping("user/makeOrder")
    public Result makeOrder( HttpServletRequest httpServletRequest, @RequestParam int tourId);
    @PostMapping("user/addTraveler")
    public Result addTraveler(@RequestParam String travelerTel, HttpServletRequest httpServletRequest,@RequestPart("front") MultipartFile card1,@RequestPart("back") MultipartFile card2) throws JSONException;
    @PostMapping("user/complaints")
    public Result makeComplaints(@RequestParam int orderId, @RequestParam String complaintsContent,HttpServletRequest httpServletRequest);
    @PostMapping("user/comment")
    public Result makeComment(@RequestParam int productId, @RequestParam String commentContent,HttpServletRequest httpServletRequest,@RequestParam List<MultipartFile> list);
    @PostMapping ("user/cancelOrder")
    public Result cancelOrder(@RequestBody cancelOrderInfo cancelOrderInfo, HttpServletRequest httpServletRequest);
    @GetMapping("user/pay")
    public void pay(@RequestParam int orderId,HttpServletResponse response);
    @GetMapping("user/refund")
    public Result refund(@RequestParam int orderId, HttpServletRequest httpServletRequest,@RequestParam List<Integer> travelerId);
//    @RequestMapping("user/trade")
//    public Result trade(HttpServletRequest httpServletRequest);
    @RequestMapping("user/success")
    public Result success(HttpServletRequest httpServletRequest);
    @GetMapping("user/selectTraveler")
    public Result selectTraveler(HttpServletRequest httpServletRequest, @RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "3") int pageNum);
    @PostMapping("user/selectTourByTime")
    public Result selectTourByTime(@RequestParam String time);
    @GetMapping("user/code")
    public Result code(@RequestParam int code);

}
